<!DOCTYPE html>
<html lang="en">
<!--header-->
<include file="Public:header"/>
<!--header-->

<section id="main-content">
    <section class="wrapper">
        <h3><i class="fa fa-angle-right"></i> 订单收益统计管理</h3>
        <div class="row mt">
            <div class="col-md-12">
                <div class="content-panel">
                    <table class="table table-striped table-advance table-hover">
                        <h4><i class="fa fa-angle-right"></i> 订单收益统计信息
                        </h4>
                        <hr>
                        <thead>
                        <div style="margin-left: 5%;">
                            <span>开始时间</span>
                            <input type="date" id="start"  name="start">
                           <span style="margin-left: 20px;">结束时间</span>
                            <input type="date" id="end"  name="end">
                            <a id="shan" href="###" class="btn btn-theme" style="margin-top: 0px;margin-left:30px;cursor: pointer;background: #68dff0;border: none;color: #fff">
                                查询
                            </a>
                        </div>
                       <div style="margin-left: 5%;margin-top: 50px;" id="orders">
                           <div style="line-height: 36px;font-weight:bold ;font-size:22px;">订单总数：{$zong}笔订单</div>
                           <div style="padding-left:3%;line-height:36px;font-size:18px;">支付订单数：{$fu}笔订单</div>
                           <div style="padding-left:3%;line-height:36px;font-size:18px;">待支付订单数：{$wei}笔订单</div>
                           <div style="line-height: 36px;font-weight:bold ;font-size:22px;">总流水：{$sum}元</div>
                           <div style="padding-left:3%;line-height:36px;font-size:18px;">待付款：{$dai}元</div>
                           <div style="padding-left:3%;line-height:36px;font-size:18px;">已付款：{$yi}元</div>
                       </div>
                    </table>
                </div>
            </div>
        </div>
    </section>
</section>

</section>
<!--footer-->
<include file="Public:footer"/>
<!--footer-->
<script type="text/javascript" src="__PUBLIC__/ui/lib/layer/2.4/layer.js"></script>
<script type="text/javascript">
    $(function() {
        //    fancybox
        jQuery(".fancybox").fancybox();
    });
</script>
<script>
    //custom select box
    $(function(){
        $('select.styled').customSelect();
    });
    $("#shan").click(function () {
        var start = $('#start').val();
        var end   = $('#end').val();
        console.log(start,end)
        $.ajax({
            type:"post",
            data:{start:start,end:end},
            url:"{:U('shan')}",
            success:function (res) {
                $("#orders").html("");
                if(res == 3){
                    layer.open({
                        title: ''
                        ,content: "请选择合适的删除时间范围！"
                    });
                    _pass = false;
                }else{
                    var arr = "";
                    arr += "<div style='line-height: 36px;font-weight:bold ;font-size:22px;'>订单总数："+res['zong']+"笔订单</div> <div style='padding-left:3%;line-height:36px;font-size:18px;'>支付订单数："+res['fu']+"笔订单</div> <div style='padding-left:3%;line-height:36px;font-size:18px;'>待支付订单数："+res['wei']+"笔订单</div> <div style='line-height: 36px;font-weight:bold ;font-size:22px;'>总流水："+res['sum']+"元</div> <div style='padding-left:3%;line-height:36px;font-size:18px;'>待付款："+res['dai']+"元</div> <div style='padding-left:3%;line-height:36px;font-size:18px;'>已付款："+res['yi']+"元</div>"
                $("#orders").append(arr);
                }
            }
        })
    })
</script>

</body>
</html>
